package la.iok.hzsvn.lewin.movie.core.shopmovie.vo;

import java.util.Date;
import java.util.Objects;

/**
 * 优惠券
 * @since 1.1.1
 */
public class CouponVo {
    private Long id;
    /**
     * 优惠券名称
     */
    private String name;
    /**
     * 发放的店铺
     */
    private Long orgUnitId;
    /**
     * 店铺名称
     */
    private String orgUnitName;
    /**
     * 优惠券的所有人
     */
    private Long userId;
    /**
     * 用户昵称
     */
    private String userNickname;
    /**
     * 用户手机号（加密）
     */
    private String userPhoneNumber;
    /**
     * 优惠券类型
     */
    private Integer type;
    /**
     * 当前剩余额度。如果是折扣券,那就是百分比的值,如五折券,值为50，表示50%；如果有金额券,值为236,那就是优惠金额236分,单位为分
     */
    private Integer amount;
    /**
     * 初始额度。发放的时候的初始额度
     */
    private Integer initAmount;
    /**
     * 最大抵扣金额。当是折扣券的时候,根据使用的实际金额，以百分比进行抵扣，如果计算的抵扣金额大于最大抵扣金额,则只能以最大抵扣金额进行抵扣
     */
    private Integer maxAmount;
    /**
     * 优惠券适用的剧本类别.如果是-1，则不限制适用的剧本类别。
     */
    private Long movieLevelId;
    /**
     * 优惠券适用的剧本类别名称
     */
    private String movieLevelName;
    /**
     * 创建优惠券的用户id
     */
    private Long createUserId;
    /**
     * 创建优惠券的用户昵称
     */
    private String createUserNickname;
    /**
     * 创建优惠券的用户手机号（加密）
     */
    private String createUserPhoneNumber;
    /**
     * 创建时间
     */
    private Date start;
    /**
     * 失效时间
     */
    private Date end;
    /**
     * 使用状态：0：未领取，1：未使用，2：部分使用（可以多次使用的情况下），3：已使用
     */
    private Integer status;
    /**
     * 数据版本
     */
    private Long version;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getOrgUnitId() {
        return orgUnitId;
    }

    public void setOrgUnitId(Long orgUnitId) {
        this.orgUnitId = orgUnitId;
    }

    public String getOrgUnitName() {
        return orgUnitName;
    }

    public void setOrgUnitName(String orgUnitName) {
        this.orgUnitName = orgUnitName;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserNickname() {
        return userNickname;
    }

    public void setUserNickname(String userNickname) {
        this.userNickname = userNickname;
    }

    public String getUserPhoneNumber() {
        return userPhoneNumber;
    }

    public void setUserPhoneNumber(String userPhoneNumber) {
        this.userPhoneNumber = userPhoneNumber;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getInitAmount() {
        return initAmount;
    }

    public void setInitAmount(Integer initAmount) {
        this.initAmount = initAmount;
    }

    public Integer getMaxAmount() {
        return maxAmount;
    }

    public void setMaxAmount(Integer maxAmount) {
        this.maxAmount = maxAmount;
    }

    public Long getMovieLevelId() {
        return movieLevelId;
    }

    public void setMovieLevelId(Long movieLevelId) {
        this.movieLevelId = movieLevelId;
    }

    public String getMovieLevelName() {
        return movieLevelName;
    }

    public void setMovieLevelName(String movieLevelName) {
        this.movieLevelName = movieLevelName;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public String getCreateUserNickname() {
        return createUserNickname;
    }

    public void setCreateUserNickname(String createUserNickname) {
        this.createUserNickname = createUserNickname;
    }

    public String getCreateUserPhoneNumber() {
        return createUserPhoneNumber;
    }

    public void setCreateUserPhoneNumber(String createUserPhoneNumber) {
        this.createUserPhoneNumber = createUserPhoneNumber;
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CouponVo)) return false;
        CouponVo couponVo = (CouponVo) o;
        return Objects.equals(id, couponVo.id) && Objects.equals(name, couponVo.name) && Objects.equals(orgUnitId, couponVo.orgUnitId)
                && Objects.equals(orgUnitName, couponVo.orgUnitName) && Objects.equals(userId, couponVo.userId)
                && Objects.equals(userNickname, couponVo.userNickname) && Objects.equals(userPhoneNumber, couponVo.userPhoneNumber)
                && Objects.equals(type, couponVo.type) && Objects.equals(amount, couponVo.amount)
                && Objects.equals(initAmount, couponVo.initAmount) && Objects.equals(maxAmount, couponVo.maxAmount)
                && Objects.equals(movieLevelId, couponVo.movieLevelId) && Objects.equals(movieLevelName, couponVo.movieLevelName)
                && Objects.equals(createUserId, couponVo.createUserId) && Objects.equals(createUserNickname, couponVo.createUserNickname)
                && Objects.equals(createUserPhoneNumber, couponVo.createUserPhoneNumber) && Objects.equals(start, couponVo.start)
                && Objects.equals(end, couponVo.end) && Objects.equals(status, couponVo.status) && Objects.equals(version, couponVo.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, orgUnitId, orgUnitName, userId, userNickname, userPhoneNumber, type, amount,
                initAmount, maxAmount, movieLevelId, movieLevelName, createUserId, createUserNickname, createUserPhoneNumber,
                start, end, status, version);
    }

    @Override
    public String toString() {
        return "CouponVo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", orgUnitId=" + orgUnitId +
                ", orgUnitName='" + orgUnitName + '\'' +
                ", userId=" + userId +
                ", userNickname='" + userNickname + '\'' +
                ", userPhoneNumber='" + userPhoneNumber + '\'' +
                ", type=" + type +
                ", amount=" + amount +
                ", initAmount=" + initAmount +
                ", maxAmount=" + maxAmount +
                ", movieLevelId=" + movieLevelId +
                ", movieLevelName='" + movieLevelName + '\'' +
                ", createUserId=" + createUserId +
                ", createUserNickname='" + createUserNickname + '\'' +
                ", createUserPhoneNumber='" + createUserPhoneNumber + '\'' +
                ", start=" + start +
                ", end=" + end +
                ", status=" + status +
                ", version=" + version +
                '}';
    }
}
